//
//  WenJianTongZhiViewController.m
//  tangshantongjiAPP
//
//  Created by yuntai on 2018/4/23.
//  Copyright © 2018年 yuntai. All rights reserved.
//

#import "WenJianTongZhiViewController.h"
#import <MJCSegmentInterface.h>
#import "NewsListViewController.h"

@interface WenJianTongZhiViewController ()<MJCSegmentDelegate>

@end

@implementation WenJianTongZhiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NewsListViewController *vc1 = [[NewsListViewController alloc]init];
    vc1.type = 18;
    NewsListViewController *vc2 = [[NewsListViewController alloc]init];
    vc2.type = 18;
    NSArray *vcarrr = @[vc1,vc2];// 用数组将控制器装起来
    NSArray *titlesArr = @[@"市级",@"县级"];
    //  准备工作做好之后,接来下实例化我的控件
    MJCSegmentInterface *segmentsface = [[MJCSegmentInterface alloc]init];
    segmentsface.titlesViewFrame = CGRectMake(0,0,self.view.jc_width, 44);
    segmentsface.frame = CGRectMake(0,kNavigationHeight, MJCScreenWidth,MJCScreenHeight-kNavigationHeight);
    segmentsface.itemTextNormalColor = kTextDeepDarkColor;
    segmentsface.itemTextSelectedColor = kNavigationColor;
    segmentsface.itemTextFontSize = 14;
//    segmentsface.indicatorHidden = YES;
    segmentsface.indicatorColor = kNavigationColor;
    [segmentsface intoTitlesArray:titlesArr hostController:self];// 传入标题数组
    [segmentsface intoChildControllerArray:vcarrr];//   传入控制器数组
    segmentsface.titlesViewBackColor = kBGColor;
    segmentsface.itemMaxEdgeinsets = MJCEdgeInsetsMake(0, 20, 0, 20, 20);
    segmentsface.delegate = self;
    [self.view addSubview:segmentsface];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
